﻿using System;
using System.Configuration;
using mojoPortal.Net;
using mojoPortal.Web;
using Resources;
using mojoPortal.Web.Framework;
using System.Collections;
using mojoPortal.Business;
using ud_gSDMS.Code_Service;
using mojoPortal.Business.WebHelpers;
using System.IO;
using Brettle.Web.NeatUpload;
using System.Collections.Generic;
using System.Web.UI.WebControls;
using System.Web.UI;
namespace ud_gSDMS.Member
{
    public partial class UpdateOthers : mojoBasePage
    {
        private int pageId = -1;
        private int moduleId = -1;
        private string id;
        private SiteUser _siteUser;
        protected String cacheDependencyKey;
        DBQLNS _respository=new DBQLNS();

        void Page_Load(object sender, EventArgs e)
        {
            _siteUser = SiteUtils.GetCurrentSiteUser();
            if (_siteUser == null)
            {
                WebUtils.SetupRedirect(this, SiteRoot + "/AccessDenied.aspx");
            }
            if (!Page.IsPostBack)
            {
                PopulateLabels();
                PopulateControls();
            }
        }
        private void PopulateLabels()
        {
            
        }
        private void PopulateControls()
        {
            leftMenuItem.CurrentSite = Request.RawUrl;
            cbo_loaicb.DataValueField = "ID";
            cbo_loaicb.DataTextField = "Name";
            cbo_loaicb.DataSource = _respository.GetAllThuocLoaiCB();
            cbo_loaicb.DataBind();

            code_test test1 = new code_test(01, "1");
            code_test test2 = new code_test(02, "2");
            code_test test3 = new code_test(03, "3");
            List<code_test> lst = new List<code_test>();
            lst.Add(test1);
            lst.Add(test2);
            lst.Add(test3);
            cbo_madv.DataValueField = "ID";
            cbo_madv.DataTextField = "Name";
            cbo_madv.DataSource = lst;
            cbo_madv.DataBind();

            cbo_makhoa.DataValueField = "ID";
            cbo_makhoa.DataTextField = "Name";
            cbo_makhoa.DataSource = lst;
            cbo_makhoa.DataBind();

            code_test test4 = new code_test(04, "LGHS");
            code_test test5 = new code_test(05, "HDDD");
            code_test test6 = new code_test(06, "HLTY");
            List<code_test> listluong = new List<code_test>();
            listluong.Add(test4);
            listluong.Add(test5);
            listluong.Add(test6);
            cbo_loailuong.DataValueField = "ID";
            cbo_loailuong.DataTextField = "Name";
            cbo_loailuong.DataSource = listluong;
            cbo_loailuong.DataBind();

            cbo_nv.DataValueField = "ID";
            cbo_nv.DataTextField = "Name";
            cbo_nv.DataSource = _respository.GetAllChuyenNganhDT();
            cbo_nv.DataBind();
            binddata();
        }

        private void binddata()
        {
            cbo_madv.SelectedItem.Text = "04";
            txttendv.Text = "P.ĐTTH";
            cbo_makhoa.SelectedItem.Text = "20";
            txttenkhoa.Text = "K.HTTT";
            cbo_loaicb.SelectedItem.Text = "BC";
            cbo_loailuong.SelectedItem.Text = "LGHS";
            txtsotd.Text = "36000338";
            txtnoicap.Text = "19/05/2004, Cần Thơ";
            cbo_nv.SelectedItem.Text = "Giảng viên chính";
            txttk.Text = "011100013047";
            txtnh.Text = "Vietcombank";
            txtmst.Text = "1800578810";
            txtbaotin.Text = "Nguyễn Thị Tuyết Nga";
            txtdiachi.Text = "Chi cục QL chất lượng hàng hóa miền Nam";
            txtsotd.Text = "0918232819";
        }
        #region OnInit

        protected override void OnPreInit(EventArgs e)
        {
            AllowSkinOverride = true;
            base.OnPreInit(e);
            Load += Page_Load;
        }

        protected override void OnInit(EventArgs e)
        {
            LoadParams();
            LoadPanels();
            base.OnInit(e);
            SuppressPageMenu();
        }
      
        private void LoadParams()
        {
            pageId = WebUtils.ParseInt32FromQueryString("pageid", pageId);
            moduleId = WebUtils.ParseInt32FromQueryString("mid", true, moduleId);
            id = WebUtils.ParseStringFromQueryString("id", id);
            cacheDependencyKey = "Module-" + moduleId.ToInvariantString();
        }

        private void LoadPanels()
        {
            bool showLeftColumnAdmin = ConfigHelper.GetBoolProperty("ShowLeftColumnAdmin", false);
            bool showRightColumnAdmin = ConfigHelper.GetBoolProperty("ShowRightColumnAdmin", false);
            bool showTopColumnAdmin = ConfigHelper.GetBoolProperty("ShowTopColumnAdmin", false);
            bool showBottomColumnAdmin = ConfigHelper.GetBoolProperty("ShowBottomColumnAdmin", false);
            int showCenterColumnAdmin = ConfigHelper.GetIntProperty("ShowCenterColumnAdmin", 0);
            LoadSideContent(showLeftColumnAdmin, showRightColumnAdmin, showTopColumnAdmin, showBottomColumnAdmin, showCenterColumnAdmin);
        }
        #endregion
        public class code_test
        {
            public int ID { get; set; }
            public string Name { get; set; }
            public code_test(int ID, string Name)
            {
                this.ID = ID;
                this.Name = Name;

            }

        }
        
    }
    public class otherupdateddata
    {
        public string madv { get; set; }
        public string makhoa { get; set; }
        public string loaicb { get; set; }
        public string tendv { get; set; }
        public string tenkhoa { get; set; }
        public string huongluong { get; set; }
        public string sothedang { get; set; }
        public string noicap { get; set; }
        public string nghiepvu { get; set; }
        public string sotk { get; set; }
        public string nganhang { get; set; }
        public string Msthue { get; set; }
        public string lydonghi { get; set; }
        public string ghichu { get; set; }
        public string lienhe { get; set; }
        public string diachi { get; set; }
        public string dienthoai { get; set; }
        public otherupdateddata(string madv, string makhoa, string loaicb, string tendv, string tenkhoa, string huongluong, string sothedang, string noicap, string nghiepvu, string sotk, string nganhang, string msthue, string lidonhngi, string ghichu,string lienhe,string diachi,string dienthoai)
        {
            this.madv = madv;
            this.makhoa = makhoa;
            this.loaicb = loaicb;
            this.tendv = tendv;
            this.tenkhoa = tenkhoa;
            this.huongluong = huongluong;
            this.sothedang = sothedang;
            this.sotk = sotk;
            this.nganhang = nganhang;
            this.Msthue = msthue;
            this.lydonghi = lidonhngi;
            this.lienhe = lienhe;
            this.diachi = diachi;
            this.dienthoai = dienthoai;
            this.nghiepvu = nghiepvu;
            this.noicap = noicap;
            this.ghichu = ghichu;
        }
    }

}